<template>
  <div class="about">
    <button @click="show = !show">Toggle</button>
    <!--transition 有name属性。如果不写 动画名称就默认"v" name如果有值他就是动画名称-->
    <transition name="fade">
      <p v-if="show">hello</p>
    </transition>
  </div>
</template>
<script>
import { ref } from 'vue';
export default {
   setup(props) {
     const show = ref(true);
     return{
       show
     }
   }
}
</script>
<style lang="scss" scoped>
.fade-enter-active {
  transition: all 0.3s ease-out;
}

.fade-leave-active {
  transition: all 0.8s cubic-bezier(1, 0.5, 0.8, 1);
}

.fade-enter-from,
.fade-leave-to {
  transform: translateX(20px);
  opacity: 0;
}
</style>
